package Leason3;

import java.util.Scanner;

public class Task8 {

	public static void main(String[] args) {

		Scanner sc = new Scanner (System.in);
		
		System.out.println("Please enter a length of the array");
		int len = sc.nextInt();
		
		int[] array = new int[len];
		
		int num;
		
		String numbers = "";
		int sum = 0;
		int numCom = 0;
		int ind = 1;
		String row = "";
		
		System.out.println("Please enter the array numbers");
		for(int i = 0; i < array.length; i++)
		{
			System.out.println("Enter the number of element " + i);
			num = sc.nextInt();
			array[i] = num;
			
			if (num != numCom)
			{
				numCom = num;
				ind = 1;
				numbers = num +" ";
			}
			else
			{
				ind++;
				numbers += num+" ";
				
				if(ind>sum)
				{
					sum = ind;
					row = numbers;
				}
			}			
		}
		
		System.out.print("The maximum row is:" + row );
		
		
		
		
		
	}

}
